<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>php redis demo</title>
<script type="text/javascript" src="js/ajax141212.js"></script>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<style>
body,h1,h2,h3,h4,h5,h6,hr,p,dl,dt,dd,ul,ol,li,pre,form,button,textarea,th,td {margin:0;padding:0;}
body,button,select,textarea {font:12px;}
ul,ol,li{list-style:none;}
img{ border:0; vertical-align:top;}
.funcparam input{ width:50px;}
.w50{ width:50px;}

.examdiv li{
	margin:0px auto; 
	width:1000px;
	margin-bottom:20px;
}

.examdiv .php{
	color: #ff3a00;
	font-weight:bold;
}

.examdiv .param{
	color: #2a00ff;

}


</style>
</head>
<body>
<?php $this->load->view("layout/topinfo");?>
<br>
<table align="center" width="1000" border="1" style="margin-top:10px;">
  <tr bgcolor="#CCCCCC">
    <td colspan="2">● LIST：<?php echo $key?><input type="button" value="删除" onclick="del('<?php echo $key?>')"></td>
    <td>操作</td>
  </tr>
<?php


		//$redis->lgetrange('key1', 0, -1);或$redis->lrange('key1', 0, -1);
		for($i=0; $i<$redis->lsize($key); $i++){
			$value = $redis->lget($key, $i);
			$value = htmlspecialchars($value);//不然JSON串显示不出来
?>

  <tr>
    <td width="100"><?php echo $i?></td>
    <td><?php echo substr($value, 0, 100)?></td>
    <td><input type="button" value="查看" onclick="jsonview('<?php echo $key?>', <?php echo $i?>)"/> </td>
  </tr>

<?php
		}
?>
</table>
<script language="javascript">

function jsonview(key, i) {
	window.open('/view/json.html?key='+key+'&i='+i); 
}

</script>
</body>
</html>

